package cn.wolfcode.trip.base.service;


import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.CommentqueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import com.github.pagehelper.PageInfo;

public interface IUserService  {
    void save(User user);

    User login(String email,String password);

    PageInfo<User> listAll(QueryObject qo);

    void update(User user);

    /**
     * 根据用户id查询用户信息
     * @param id 用户id
     * @return
     */
    User getUser(Long id);

    /**
     * 判断是否为关注状态
     * @param currentId 当前登录用户id
     * @param userId 页面用户id
     * @return
     */
    boolean isFollower(Long currentId, Long userId);

    /**
     * 添加关注关系
     * @param currentId 当前登录用户id
     * @param userId 页面用户id
     */
    void saveRelation(Long currentId, Long userId);

    void deleteRelation(Long currentId, Long userId);

    /**
     * 更新用户的粉丝和关注的数量
     * @param user
     */
    void updateFansAndFollowersCount(User user);

    void updateState(Long userid,long stateDisable);

    User selectUserById(Long id);


    Object countUnReadcomment(CommentqueryObject qo);

    PageInfo<?> usecomment(CommentqueryObject qo);
    PageInfo<?> othercomment(CommentqueryObject qo);
}
